import request from "@/utils/request";
/**
 * 获取购物车
 * @param {*} params
 */
// 分页查询
export function listMyCar(params) {
  return request({
    url: "/front/cart/listMyCart",
    method: "post",
    params
  });
}

// 加入购物车
export function saveOrUpdate(params) {
  return request({
    url: "/front/cart/saveOrUpdate",
    method: "post",
    params
  });
}

// 确认订单结算或立即购买结算。需要判断最小起订量
export function confirm(params) {
  return request({
    url: "/front/cart/confirm",
    method: "post",
    params
  });
}

// 创建订单
export function create(params) {
  return request({
    url: "/front/order/create",
    method: "post",
    params
  });
}

// 购物车删除
export function removeByIds(params) {
  return request({
    url: "/front/cart/removeByIds",
    method: "post",
    params
  });
}

// 预支付。获取支付链接
export function prepay(params) {
  return request({
    url: "/front/pay/prepay",
    method: "post",
    params
  });
}

// 收藏商品
export function collect(params) {
  return request({
    url: "/front/collect/collect",
    method: "post",
    params
  });
}
